package org.holynite.fieldmanage.entities

import javax.persistence.Column
import javax.persistence.Embeddable

/**
 * Created by midnite on 15/1/15.
 */
@Embeddable
class CommodityDiscountSchemeCustomerTypePK {
	@Column(name = "scheme_id")
	String schemeId
	@Column(name = "customer_type_id")
	String customerTypeId

	boolean equals(o) {
		if (this.is(o)) return true
		if (getClass() != o.class) return false

		CommodityDiscountSchemeCustomerTypePK that = (CommodityDiscountSchemeCustomerTypePK) o

		if (customerTypeId != that.customerTypeId) return false
		if (schemeId != that.schemeId) return false

		return true
	}

	int hashCode() {
		int result
		result = (schemeId != null ? schemeId.hashCode() : 0)
		result = 31 * result + (customerTypeId != null ? customerTypeId.hashCode() : 0)
		return result
	}
}
